{include file="inc/header_index_mui.html"}

<link rel="stylesheet" href="css/shop_tc.css" />
<script src="https://ss0.bdstatic.com/5aV1bjqh_Q23odCf/static/superman/js/lib/jquery-1.10.2_d88366fd.js"></script>
<script src="js/mui.min.js"></script>

{include file="inc/footer_menu_mui.html"}

<div class="mui-content">
			<div class="re"><img  class="aui-col-10 fix aui-light-top aui-zindex-9"  src="image/light.png" alt="" /></div>
			
			<div class="mui-slider">
			    <div class="mui-slider-group mui-slider-loop" style="height:160px;">
			    <!--支持循环，需要重复图片节点-->
				    {if $data.advs}
					
					{foreach from="$data.advs" item="adv"}
						<div class="mui-slider-item mui-slider-item-duplicate"><a href="{$adv.url}"><img src="{$adv.img}" /></a></div>
						<div class="mui-slider-item"><a href="{$adv.url}"><img src="{$adv.img}" /></a></div>
					{/foreach}

					{/if}
				<!--支持循环，需要重复图片节点-->
				   
			    </div>
		   </div>
		   <!-------轮播图-------->
		   
		    <div class="mui-row aui-pad-t-10">
		    	<div class="mui-col-sm-4 mui-col-xs-4 mui-text-center ">
		    		<img class="aui-col-8" style="border-right:1px solid #000;padding-right: 20px;" src="image/index_jiebao.png" alt="" />
		    	</div>
		    	<div class="mui-col-sm-8 mui-col-xs-8 hidden">
		    		<div id="lunbo_content" class="hidden "   style="height: 32px;">
						<div class="re hidden" id="lunbo" style="top: 1px;">
		    			{if $data.newest_lottery_list}
						{foreach from=$data.newest_lottery_list item=lottery_unit}
						<p class="aui-color-red ">&nbsp;恭喜&nbsp;{$lottery_unit.user_name}&nbsp;获得{$lottery_unit.name}&nbsp;</p>
						{/foreach}
						{/if}
						</div>
		    		</div>
		    	</div>
		    </div>
		    <!--广播滚动-->
		    
			<ul class="mui-table-view">
			     <li class="mui-table-view-cell mui-media">
			        <a href="javascript:;">
			            <img class="aui-col-2 mui-pull-left" src="image/phone.jpg" style="margin-right:10px;" />
			            <div class="mui-media-body aui-pad-t-5">
			            	<div class="fr mui-text-center">
			            	<button class="buy mui-btn mui-btn-primary aui-border-radius-30 aui-pad-l-15 aui-pad-r-15" onclick="buy(5,'散酒五钱','散酒五钱 = 5元')">购买</button>
			            	<p>￥5</p>
			            	</div>
			               	 散酒五钱
			                <p class='mui-ellipsis'>散酒五钱 = 5元</p>
			            </div>
			        </a>
			    </li>
			    <li class="mui-table-view-cell mui-media">
			        <a href="javascript:;">
			            <img class="aui-col-2 mui-pull-left" src="image/phone.jpg" style="margin-right:10px;" />
			            <div class="mui-media-body aui-pad-t-5">
			            	<div class="fr mui-text-center">
			            	<button class="buy mui-btn mui-btn-primary aui-border-radius-30  aui-pad-l-15 aui-pad-r-15" onclick="buy(100,'散酒一瓶','散酒一瓶 = 一百钱 = 100元')">购买</button>
			            	<p>￥100</p>
			            	</div>
			               	 散酒一瓶
			                <p class='mui-ellipsis'>散酒一瓶 = 一百钱 = 100元</p>
			            </div>
			        </a>
			    </li>
			     <li class="mui-table-view-cell mui-media">
			        <a href="javascript:;">
			            <img class="aui-col-2 mui-pull-left" src="image/shop_one.png" style="margin-right:10px;" />
			            <div class="mui-media-body aui-pad-t-5">
			            	<div class="fr mui-text-center">
			            	<button class="buy mui-btn mui-btn-primary aui-border-radius-30  aui-pad-l-15 aui-pad-r-15" onclick="buy(10,'第一关入场券','梦想挑战赛第一关入场券')">购买</button>
			            	<p>10积分</p>
			            	</div>
			               	 第一关入场券
			                <p class='mui-ellipsis'>梦想挑战赛第一关入场券</p>
			            </div>
			        </a>
			    </li>
				 <li class="mui-table-view-cell mui-media">
			        <a href="javascript:;">
			            <img class="aui-col-2 mui-pull-left" src="image/shop_two.png" style="margin-right:10px;" />
			            <div class="mui-media-body aui-pad-t-5">
			            	<div class="fr mui-text-center">
			            	<button class="buy mui-btn mui-btn-primary aui-border-radius-30  aui-pad-l-15 aui-pad-r-15" onclick="buy(200,'第二关入场券','梦想挑战赛第二关入场券')">购买</button>
			            	<p>200积分</p>
			            	</div>
			               	 第二关入场券
			                <p class='mui-ellipsis'>梦想挑战赛第二关入场券</p>
			            </div>
			        </a>
			    </li>
			</ul>
			
		   <!----------购买弹窗开始--------->
		   <div class="alert_bg">
			   <div class="alert_tc aui-col-8 re aui-pad-15 mui-text-center">
			   		<img class="ab jiu" src="image/jiu_t.png" alt="" width="100px"/>
			   		<div class="aui-background-white aui-mar-t-15 aui-border-radius hidden" style="height:150px;">
			   			<h3 class="aui-pad-t-10"><b id="buy_0">加载中</b></h3>
			   			<h4>商品介绍</h4>
			   			<p class="aui-pad-10 mui-text-left hidden" id="buy_1">加载中</p>
			   		</div>
					<div class="mui-numbox aui-mar-t-10" data-numbox-step='1' data-numbox-min='1' data-numbox-max='10'>
					  <!-- "-"按钮，点击可减小当前数值 -->
					  <button class="mui-btn mui-numbox-btn-minus" type="button">-</button>
					  <input class="mui-numbox-input" type="number" id="buy_num" />
					  <!-- "+"按钮，点击可增大当前数值 -->
					  <button class="mui-btn mui-numbox-btn-plus" type="button">+</button>
					</div>
					<div class="mui-row aui-mar-t-15">
						<div class="mui-col-sm-6 mui-col-xs-6 "><button type="button" class="cancel mui-btn mui-btn-danger aui-border-radius-30 aui-col-7">取消</button></div>
						<div class="mui-col-sm-6 mui-col-xs-6 " id="buy_btn"><button type="button" class="mui-btn mui-btn-warning aui-border-radius-30 aui-col-7"><a class="aui-color-white" href="javascript:void(0);">确认</a></button></div>
					</div>
			   </div>
		   </div>
		  <!-------购买弹窗开始---------->
		</div>
		<input type="hidden" id="buy_money" value=0>
		
		<script>
			//获得slider插件对象
			var gallery = mui('.mui-slider');
			gallery.slider({
			  interval:5000//自动轮播周期，若为0则不自动播放，默认为0；
			});
			function buy(str0,str1,str2){
				$("#buy_0").html(str1);
				$("#buy_1").html(str2);
				$("#buy_num").val(1);
				$("#buy_money").val(str0);
			}
			
			document.querySelector('#buy_btn').addEventListener('click',function () {
				var buy_money=$("#buy_money").val();
				var buy_num=$("#buy_num").val();
				if(buy_money==10 || buy_money==200){
					$.ajax({
						url: 'index.php?ctl=deal&act=goumaircq',
						type: 'POST',
						data: 'buy_money=' + buy_money + '&buy_num=' + buy_num +'&t=' + Math.random(),
						dataType: "json",
						success: function (data) {
							console.log(data);
							if(data.status=="1"){
								alert(data.info);
								location.href="index.php?ctl=user_center";
								
							}else{
								alert(data.info);
							}
						},
						error: function () {
							//alert("系统错误，请联系管理员");
						}
					});	
				}else{
					location.href="index.php?ctl=uc_charge&money="+buy_num*buy_money;
				}
			})
  
		</script>
		
		

		<script type="text/javascript">
			mui.init()
		</script>
	</body>
	<script src="js/lunbo.js"></script>
	<script>
		
		$(".buy").click(function(){
			$(".alert_bg").show();
		})
		$(".cancel").click(function(){
			$(".alert_bg").hide();
		}) 
		
		
	</script>

